{% extends "base.html" %}
{% block css %}<link rel="stylesheet" type="text/css" href="{{settings.URL_ROOT}}media/css/codewiki.css" />{% endblock %}

{% block title %}Cached pages {{dirname}}{% endblock %}

{% block content %}
{% if message %}<h3>message: {{message}}</h3>{% endif %}

{% if scrapernames %}
<h2>Cached pages for scraper-tag: &quot;{{scraper_tag}}&quot;</h2>

<table class="dividers">
<tr><th>Original</th><th>Cached (by tag)</th><th>Scrape time</th><th>Length</th><th>Copies</th></tr>
{% for scrapername, scrapertexts in scrapernames %}
  <tr>
    <td>{{scrapertexts.0.url|urlizetrunc:35}}</td>
    <td><a href="{{settings.URL_ROOT}}scraped/{{scraper_tag}}/{{scrapername}}">{{scrapername}}</a></td>
    <td>{{scrapertexts.0.scrape_time}}</td>
    <td>{{scrapertexts.0.text|length}}</td>
    <td>{{scrapertexts|length}}</td>
  </tr>
{% endfor %}
</table>

{% else %}
  {% if scraper_tag %}
  <p>No cached pages for the tag: &quot;{{scraper_tag}}&quot;</p>
  {% endif %}
{% endif %}


{% if scraper_tag %}
<h2>Other scraper tags</h2>
{% else %}
<h2>Cached pages are available under the following tags</h2>
{% endif %}
<ul>
{% for lscraper_tag in scraper_tags %}
    <li><a href="{{settings.URL_ROOT}}scraped/{{lscraper_tag}}">{{lscraper_tag}}</a></li>
{% endfor %}
</ul>

{% endblock %}
